import request from '@/utils/request'

// 查询分页公文列表
export function getDocMyPageList(query) {
    return request({
        url: '/doc/my/page',
        method: 'get',
        params: query
    })
}

export function getDocMyTemplatePageList(query) {
    return request({
        url: '/doc/my/fileTemplate/page',
        method: 'get',
        params: query
    })
}

export function getDocDeptPageList(query) {
    return request({
        url: '/doc/deptSelect/page',
        method: 'get',
        params: query
    })
}

// 新增公文
export function addDoc(data) {
  return request({
    url: '/doc/my/add',
    method: 'post',
    data: data
  })
}

// 查询公文基本信息
export function getDocMyBasicInfo(id) {
    return request({
        url: '/doc/my/getDocBasicInfo/' + id,
        method: 'get'
    })
}

// 修改公文基本信息
export function updateDocMyBasicInfo(data) {
    return request({
        url: '/doc/my/update',
        method: 'put',
        data: data
    })
}

// 删除公文
export function deleteDoc(id) {
    return request({
        url: '/doc/my/delete/' + id,
        method: 'delete'
    })
}

// 查询公文页面所有权限控制按钮
export function getButtons(id) {
    return request({
        url: '/doc/my/getButton/' + id,
        method: 'get'
    })
}

//起草完毕，进入审核中
export function draftComplete(id) {
    return request({
        url: '/doc/my/draftComplete/' + id,
        method: 'put'
    })
}

// 废弃公文
export function cancelDoc(id) {
    return request({
        url: '/doc/my/cancel/' + id,
        method: 'put'
    })
}

//审核修订中--申请审核
export function applyAudit(query) {
    return request({
        url: '/doc/my/applyAudit',
        method: 'put',
        params: query
    })
}

//审核完毕，进入会签
export function auditComplete(id) {
    return request({
        url: '/doc/my/auditComplete/' + id,
        method: 'put'
    })
}

//会签--申请会签
export function applyJointSign(query) {
    return request({
        url: '/doc/my/applyJointSign',
        method: 'put',
        params: query
    })
}

//会签完毕，进入领导签发
export function jointSignComplete(id) {
    return request({
        url: '/doc/my/jointSignComplete/' + id,
        method: 'put'
    })
}

//领导签发--申请签发
export function applyLeaderSign(query) {
    return request({
        url: '/doc/my/applyLeaderSign',
        method: 'put',
        params: query
    })
}

// 查询分页套红模板列表
export function getDocMyRedSheetTemplatePageList(query) {
    return request({
        url: '/doc/my/redSheetTemplate/page',
        method: 'get',
        params: query
    })
}

//正文套红
export function redSheetAutoFill(query) {
    return request({
        url: '/doc/my/redSheetAutoFill',
        method: 'post',
        params: query
    })
}

//签发完毕，进入清稿套红
export function leaderSignComplete(id) {
    return request({
        url: '/doc/my/leaderSignComplete/' + id,
        method: 'put'
    })
}

//盖章--申请盖章
export function applySign(query) {
    return request({
        url: '/doc/my/applySign',
        method: 'put',
        params: query
    })
}

//盖章完毕，进入分发
export function signComplete(id) {
    return request({
        url: '/doc/my/signComplete/' + id,
        method: 'put'
    })
}

//分发完毕，进入办结
export function distributeComplete(id) {
    return request({
        url: '/doc/my/distributeAndComplete/' + id,
        method: 'put'
    })
}

//确认归档
export function archiveComplete(id) {
    return request({
        url: '/doc/my/complete/' + id,
        method: 'put'
    })
}